//
//  SMRZViewController.m
//  YaDiuDiu
//
//  Created by 欧洪飞 on 2017/8/25.
//  Copyright © 2017年 jy. All rights reserved.
//

#import "SMRZViewController.h"

#import "XSZViewController.h"
#import "JSZViewController.h"
#import "XueLiViewController.h"
#import "SFZViewController.h"
@interface SMRZViewController ()<UITableViewDelegate,UITableViewDataSource>{
    NSArray *array;
}

@property (nonatomic,strong)UITableView *tableView;

@end

@implementation SMRZViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.backgroundColor = COLOR_RGB(242, 242, 242, 1);
    [self showNav:@"实名认证"];
    array = @[@"身份证",@"学历",@"驾驶证",@"行驶证"];
    [self loadUI];
}

- (void)loadUI{
    _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, ScreenWidth, 44*4) style:UITableViewStylePlain];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    _tableView.scrollEnabled = NO;
    [self.view addSubview:_tableView];
    
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return array.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *cellId = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellId];
    }
    
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    cell.textLabel.text = array[indexPath.row];
    cell.textLabel.font = [UIFont systemFontOfSize:15.0];
    cell.detailTextLabel.text = @"去认证";
    cell.detailTextLabel.font = [UIFont systemFontOfSize:13.0];
    
    return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row == 0) {
        SFZViewController *sfz = [[SFZViewController alloc] init];
        [self.navigationController pushViewController:sfz animated:YES];
    }else if (indexPath.row == 1){
        XueLiViewController *xueli = [[XueLiViewController alloc] init];
        [self.navigationController pushViewController:xueli animated:YES];
    }else if (indexPath.row == 2){
        JSZViewController *jsz = [[JSZViewController alloc] init];
        [self.navigationController pushViewController:jsz animated:YES];
    }else{
        XSZViewController *sfz = [[XSZViewController alloc] init];
        [self.navigationController pushViewController:sfz animated:YES];
    }
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
